using DC2010.Objects;
using DC2010.Objects.Base;
using DC2010.Objects.Data;

namespace DC2010.Effects
{
    public class ActionEffectLogic : EffectLogic
    {
        public ActionEffectLogic(EffectData ed) : base(ed)
        {
        }

		CreatureData attackerData = null;
		CreatureData victimData = null;

		CreatureInfo attackerInfo = null;
		CreatureInfo victimInfo = null;
		
		PartyData attackerPartyData = null;
		PartyData victimPartyData = null;

		// party is standing in front of wall or door.
		TileData victimTile = null;
		
		public virtual void DoAction(BaseObject aAction, BaseObject aAttacker) {}
		
        /// <summary>
        /// 
        /// </summary>
        /// <param name="aAction">Which action u are attacking with - attack parameters. Action must be instantiated. It should be at this moment.</param>
        /// <param name="aAttacker">Creature who is attacking - target is determined elsewhere</param>
        public override void Instant(BaseObject aAction, BaseObject aAttacker)
        {
			if (aAction is ActionData)
			{
                BeforeAction((ActionData)aAction, aAttacker);

				DoAction(aAction, aAttacker);

                AfterAction((ActionData)aAction);
			}
        }		
		
		/// <summary>
		/// Prepares all relevant variable whi will be lately used for action
		public void BeforeAction(ActionData aAction, BaseObject aAttacker)
		{
			if (aAttacker is CreatureData)
			{
				attackerData = (CreatureData)aAttacker;
				
				//who can this attacker attack? Get victim...but rememeber there can be no victim as well....door/wall is also victim....
			
			}
			
			// determine who is in front of me.
			PartyData pdAttackedParty = null;//AttackedParty
			// we will not simply call CalculationsAttack.Attack method.
			
			//CreatureData attackedCreature = AttackedParty.L.FindFirstMonster(pParam.attackX, pParam.attackY);
			
			// this above move to some "Base method used by all effects."

		
		}
		
		public void AfterAction(ActionData aAction)
		{
			//disable time
			//AdjustStamina(pChar, pParam.staminaCost);
			//AdjustSkills
		
		}
		
		
	}
}